package com.davidhigenbottam.HeatMap.shared;

import java.io.Serializable;
import java.util.List;


public class Results implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	
	private List<Province> provinces;
	private List<Institution> institutions;
	
	
	double institutionsMaxVal;
	double institutionsMinVal;
	
	public Results() {
		super();
	}
	


	public List<Province> getProvinces() {
		return provinces;
	}
	public void setProvinces(List<Province> provinces) {
		this.provinces = provinces;
	}
	public List<Institution> getInstitutions() {
		return institutions;
	}
	public void setInstitutions(List<Institution> institutions) {
		this.institutions = institutions;
	}
	public double getInstitutionsMaxVal() {
		return institutionsMaxVal;
	}
	public void setInstitutionsMaxVal(double institutionsMaxVal) {
		this.institutionsMaxVal = institutionsMaxVal;
	}
	public double getInstitutionsMinVal() {
		return institutionsMinVal;
	}
	public void setInstitutionsMinVal(double institutionsMinVal) {
		this.institutionsMinVal = institutionsMinVal;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	public boolean hasInstitutions(){
		return institutions!=null;
	}

	
	/**
	 * @param i
	 * @return scale of institution between 0 and 1
	 */
	public double getInstitutionScale(Institution i){
		return (i.getVal()-institutionsMinVal)/(institutionsMaxVal-institutionsMinVal);
	}
	
	
}
